package shared;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;

public interface MasterServerInterface extends Remote 
{
	
	//for handshake
	public String hello() throws RemoteException;
	
	//interfaces for client
	public User signUp(User user) throws RemoteException; 
	
	public User logOn(String username, String password) throws RemoteException;
	
	public User getUser(String username) throws RemoteException;
	
	
	/**
	 * @pre the pathname field, isDirectory field of newFile must be filled
	 * @param newFile
	 * @return
	 */
	public FileDescriptor requestCreate(FileDescriptor newFile) throws RemoteException;
	
	public boolean requestDelete(long fileID) throws RemoteException;
	
	public FileDescriptor requestModify(FileDescriptor theFile) throws RemoteException;
	
	public FileDescriptor getLatestFileDescriptor(long fileID) throws RemoteException;
	
	public void requestShare(long fileID, String username) throws RemoteException;
	
	public void confirmShare(long fileID, String username) throws RemoteException; 
	
	public boolean testConnection() throws RemoteException;
	
	//interfaces for client ends
	
	
	//interfaces for dataserver
	public void registerDataserver(DataServerState state) throws RemoteException;
	
	public void completeWrite(DataServerState dataServerState, FileDescriptor descriptor) throws RemoteException;
	
	//interfaces for dataserver ends
	
	
	
	
	
	
	
}
